const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const webpack = require('webpack')

module.exports = {
  entry: './src/index.js',
  output: {
    filename: 'index.js',
    path: path.resolve(__dirname, 'dist'),
    publicPath: '/'
  },
  plugins: [
    new HtmlWebpackPlugin({
      title: 'cross-domain',
      filename: 'index.html'
      // template: 'index.html'
    }),
    // HMR
    new webpack.HotModuleReplacementPlugin()
  ]
}
